package com.market.controller;

import com.market.common.vo.ResponseCode;
import com.market.common.vo.ResponseResult;
import com.market.entity.Financing;
import com.market.service.FinancingService;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/cashier")
public class FinancingController {
    @Resource
    FinancingService financingService;

    /**
     * 终端财务收银明细
     * @param initial
     * @param number
     * @return
     */
    @GetMapping("/selectCashier")
    public ResponseResult<List<Financing>> selectCashier(Integer initial,Integer number) {
        List<Financing> financings = financingService.selectCashier(initial, number);
        return ResponseResult.success(ResponseCode.SUCCESS, financings);
    }

    /**
     * 终端财务收银明细-订单号查询
     * @param odd
     * @return
     */
    @GetMapping("/oddSelect")
    public ResponseResult<Financing> oddSelect(String odd) {
        Financing financing = financingService.oddSelect(odd);
        return ResponseResult.success(ResponseCode.SUCCESS, financing);
    }
}
